|
|
|
|
Seventh Week Assignment:
We're going to program the echo-Hello-World board through this week's assignment.
Hello_Echo_Arduino:
first of all, i downloaded the ATtiny board files and located it in Arduino sketchbook folder.
i restarted the Arduino IDE to find it updated with Attiny 44 in Board menu.
After that i connected the board with power and the Fab-ISP, selected USBtinyISP from programmer menu, and finally burnt the bootloader.
CODING TIME!!
CODE:
int LED = 7;
int Button = 12;
int ButtonRead;
void setup(){
pinMode(LED,OUTPUT);
pinMode(Button,INPUT);
}
void loop(){
ButtonRead=digitalRead(Button);
if(ButtonRead == 1){
digitalWrite(LED,HIGH);
delay(100);
digitalWrite(LED,LOW);
delay(100);
}else if(ButtonRead == 0){
digitalWrite(LED,LOW);
}
}
AND IT'S BLINKING !!
Hello_Echo_C:
i downloaded the files: hello.ftdi.44.echo.c & hello.ftdi.44.echo.c.make
my board is already configured to run at 20 MHz when i burnt the bootloader in the first time.
to program it, i opened the terminal and navigated to where i saved the C code and wrote:
sudo make -f hello.ftdi.44.echo.c.make program-usbtiny
Next step, i run Arduino IDE and opened the serial monitor to see it in action!
|